package com.ghoul.gateway.modular.example;


import com.ghoul.dubbo.api.test.HelloService;
import com.ghoul.gateway.base.persistence.entity.SimpleObject;
import com.ghoul.gateway.modular.vo.RestResponse;
import org.springframework.web.bind.annotation.*;

/**
 * 常规控制器
 *
 * @author fengshuonan
 * @date 2017-08-23 16:02
 */
@RestController
@RequestMapping("/hello")
public class ExampleController {

    // @Reference(interfaceClass = HelloService.class, check = false)
    HelloService helloService;

    @PostMapping("/test1")
    public RestResponse<TestVO> hello(@RequestBody SimpleObject simpleObject) {
        //   helloService.sayHello(simpleObject.getUser());
        TestVO testVO = new TestVO();
        testVO.setId(1);
        testVO.setTest("测试");
        return RestResponse.success(testVO);
    }

    @GetMapping("/test2/{id}")
    public RestResponse<TestVO> hello2(@PathVariable Integer id) {
        return RestResponse.success();
    }
}
